<template>
	<view>
		<view class="box">
			<view class="leftbox">
				<view class="upbox" @click="tocoupon()" >
					<image src="/static/aa1.png" mode="widthFix" style="width: 100%;"></image>
					<!-- <view class="titbox">
						<view class="coupon">云智慧选优惠券</view>
						<view class="Vouchertransfer">券划算</view>
					</view> -->
					<!-- coupon_type  类型 1满减券 2折扣券 3现金券 -->
					<!-- <view class="imgbox">
						<view class="couponimg" v-for="(item,idnex) in couponList" :key="index">
							<view class="bgview">
								<view style="padding: 20rpx 0;color: #893C24;font-size: 20rpx;font-weight: 500">
									{{item.coupon_money}}</view>
								<view>{{item.coupon_type==1?'满减券':item.coupon_type==2?'折扣券':'现金券'}}</view>
							</view>
						</view>
					</view> -->
				</view>
				<view class="upbox" @click="togoodgoods()">
					<image src="https://zdcloud.zxkjnc.com/images/aa3.png" mode="heightFix" style="height: 80%;"></image>
					<!-- <view class="titbox">
						<view class="coupon">有好货</view>
						<view class="Vouchertransfer" style="background-color: #0591E5;">好口碑</view>
						<view class="Vouchertransfer" style="background-color: red;margin-left: 10rpx;">秒杀</view>
					</view>
					<view class="imgbox">
						<image style="width: 300rpx; height: 120rpx;margin: 0 auto;" src="../static/33.png"></image>
						<view v-for="(item,index) in goodsStuff" :key="index">
							<image v-if="index==0" :src="item.url"></image>
							<image v-if="index==1" :src="item.url"></image>
						</view>
					</view> -->
				</view>
			</view>
			<view class="leftbox">
				<view class="upbox" @click="tosupermarket()">
					<image src="../static/aa2.png" mode="heightFix" style="height: 90%;"></image>
					<!-- <view class="titbox">
						<view class="coupon">商超百货</view>
						<view class="Vouchertransfer" style="background:#FFF">
							<image src="../static/11.png"></image>
						</view>
					</view>
					<view class="imgbox">
						<image style="width: 300rpx; height: 120rpx;margin: 0 auto;" src="../static/11.png"></image>
						<view class="living">
							<image src="../static/eg3.png"></image>
							<view class="livingname">adidas阿优生活直播阿优生活直播</view>
						</view>
						<view>
							<image class="bigimg" src="../static/eg1.png"></image>
						</view>
					</view> -->
				</view>
				<view class="upbox" @click="toyoushop()">
					<image src="https://zdcloud.zxkjnc.com/images/aa4.png" mode="heightFix" style="height: 95%;"></image>
					<!-- <view class="titbox">
						<view class="coupon">免税商城</view>
						<view class="Vouchertransfer">应有尽有</view>
					</view>
					<view class="imgbox">
						<image style="width: 300rpx; height: 120rpx;margin: 0 auto;" src="../static/222.png"></image>
						<view><image src="../static/eg2.png"></image></view>
						<view><image src="../static/eg3.png"></image></view>
					</view> -->
				</view>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: "homemain",
		props: {
			goodsStuff: {
				type: Array,
				default: []
			},
			couponList: {
				type: Array,
				default: []
			}
		},
		data() {
			return {

			};
		},
		methods: {
			togoodgoods() {
				uni.navigateTo({
					url: '/pageshop/goodsavailable/goodsavailable'
				})
			},
			//去优惠券
			tocoupon() {
				uni.navigateTo({
					url: '/pageshop/coupon/coupon'
				})
			},
			//跳优生活
			toyoushop() {
				uni.navigateToMiniProgram({
					appId: 'wx79fc37c6d30b66d9',
					path: 'pages/home/index?pid='+260574,
					extraData: {
						'data1': 'test'
					},
					success(res) {
						// 打开成功
					}
				})
				// uni.switchTab({
				// 	url:'/pages/goodgoods/goodgoods'
				// })
			},
			//超市
			tosupermarket() {
				uni.navigateTo({
					url: '/pageshop/supermarket/supermarket'
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.box {
		width: 690rpx;
		height: 370rpx;
		background: #FFFFFF;
		border-radius: 22rpx;
		background: url(https://shex.app65.cn/images/a7c.png) no-repeat;
		background-size: 690rpx 370rpx;
		margin: 0 auto;
		display: flex;

		.leftbox {
			width: 50%;

			.upbox {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 100%;
				height: 185rpx;

				.titbox {
					display: flex;
					align-items: center;
					height: 52rpx;

					.coupon {
						font-size: 30rpx;
						font-family: Source Han Sans CN-Medium, Source Han Sans CN;
						font-weight: 500;
						color: #131313;
						margin: 0 10rpx;
					}

					.Vouchertransfer {
						width: fit-content;
						height: 30rpx;
						background: #F94D29;
						border-radius: 6rpx;
						color: #FFF;
						padding: 0 5rpx;
						line-height: 30rpx;
						font-size: 22rpx;
						font-family: Source Han Sans CN-Regular, Source Han Sans CN;
						font-weight: 400;
						color: #FFFFFF;

						image {
							width: 30rpx;
							height: 30rpx;
						}
					}
				}

				.imgbox {
					width: 100%;
					display: flex;
					align-items: center;

					// justify-content: space-around;
					// position: relative;
					.couponimg {

						width: 50%;
						text-align: center;

						.bgview {
							width: 124rpx;
							height: 108rpx;
							background-image: url('../static/coupon.png');
							background-size: 124rpx 108rpx;
							margin: 0 auto;
							font-size: 20rpx;
							font-family: Source Han Sans CN-Medium, Source Han Sans CN;
							font-weight: 500;
							color: #893C24;

							>view {
								font-size: 18rpx;
								font-family: Source Han Sans CN-Medium, Source Han Sans CN;
								font-weight: 500;
								color: #FFFFFF;
								margin-top: 5rpx;
							}
						}
					}

					.living {
						width: 50%;
						text-align: center;
						position: relative;

						image {
							width: 110rpx;
							height: 110rpx;
							border-radius: 100%;
							border: 2rpx solid #F94D29;
						}

						.livingname {
							position: absolute;
							left: 50%;
							transform: translate(-50%, 0);
							bottom: 5rpx;
							max-width: 108rpx;
							padding: 0 10rpx;
							height: 28rpx;
							background: linear-gradient(90deg, #F94D29 0%, #F99529 100%);
							border-radius: 6rpx;
							-webkit-line-clamp: 1;
							display: -webkit-box;
							-webkit-box-orient: vertical;
							overflow: hidden;
							text-overflow: ellipsis;
							line-height: 28rpx;
							font-size: 18rpx;
							font-family: SourceHanSansCN-Medium-, SourceHanSansCN-Medium;
							font-weight: normal;
							color: #FFFFFF;
						}
					}

					>view {
						width: 50%;
						text-align: center;

						image {
							width: 124rpx;
							height: 128rpx;
						}

						.bigimg {
							position: absolute;
							width: 158rpx;
							height: 172rpx;
							margin: -110rpx 0 0 -90rpx;
						}
					}
				}
			}

		}
	}
</style>